Skip to content

gh-153259: Add tkinter.systray -- system tray icon and notifications#153260

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:tkinter-systray
Jul 11, 2026
Merged

gh-153259: Add tkinter.systray -- system tray icon and notifications#153260
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:tkinter-systray

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 7, 2026

Copy link
Copy Markdown
Member

Add a tkinter.systray module wrapping the tk systray and tk sysnotify commands (Tk 8.7/9.0 and newer), which display a system tray (or taskbar) icon and send desktop notifications.

  • SysTrayIcon wraps tk systray. Only one icon exists per Tcl interpreter, so SysTrayIcon is a handle to it: with exists=False (the default) a new icon is created (and a second one raises TclError), and with exists=True the instance refers to the already-existing icon. It supports the image, text, button1 and button3 options, configure()/config(), cget(), exists() and destroy().
  • notify() and SysTrayIcon.notify() wrap tk sysnotify. On Windows a notification requires an existing tray icon, so the module function is for the other platforms and the method for Windows.

The tests require a GUI and create a real tray icon, so they are skipped where one cannot be created.

…tions

Add the tkinter.systray module with the SysTrayIcon class wrapping the
"tk systray" command and the notify() function wrapping "tk sysnotify"
(Tk 8.7/9.0 and newer).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) July 11, 2026 04:42
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33540779 | 📁 Comparing 61dee49 against main (c22e9c9)

  🔍 Preview build  

7 files changed · + 1 added · ± 6 modified

+ Added

± Modified

@serhiy-storchaka serhiy-storchaka merged commit 342e5a4 into python:main Jul 11, 2026
51 checks passed
@serhiy-storchaka serhiy-storchaka deleted the tkinter-systray branch July 11, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant